New Password
Description
This Endpoint allows a new password to be set after the user requested a password reset. It is used on the landing page where the new password is entered. It expects the two parameters from the url.
https://thenights.app/resetpassword/' + urlsafe_base64_encode(force_bytes(user.pk)) + '/' + token
Endpoint
POST https://api.thenights.app/user_manager/newpassword
Request
Headers
| Key | Value |
|---|---|
| Content-Type | application/json |
Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| uidb64 | String | yes | uidb64 from the reset link |
| token | String | yes | token from the reset link |
| password1 | String | yes | password field |
| password2 | String | yes | repeat password field |
Example Request Body
{
"uidb64": "Mjg4ZDRiMjItNzU2OC00ZGFkLTkwMjUtZTQ2MWZhMmZhZjYx",
"token": "bonxkf-f4b82f2b58a9b0a291f0e27c78af5507",
"password1": "hello28üä_",
"password2": "hello28üä_"
}
Response
Success Response
Code: 200 OK
| Parameter | Type | Description |
|---|---|---|
| detail | String | - |
Example Response Body
{
"detail": "Password updated."
}
Error Response
Code: 400 Bad Request
| Parameter | Type | Description |
|---|---|---|
| detail | String | - |
Example Response Body
{
"detail": "Password reset failed."
}
{
"detail": "Passwords do not match."
}
Email
After the password has been successfully reset, we send out a seccond mail to the user to inform them. This email includes the ip-adress of the client, who made the response.